<template>
  <div class="container" ref="container">
    <div class="top">
      <div class="top-screen1"></div>
      <div class="top-screen2"></div>
      <el-carousel height="600px" :interval="5000">
        <el-carousel-item v-for="(item, index) in roulous" :key="index">
          <div>
            <el-image style="width: 100vw; height: 600px" :src="item.url" fit="cover"></el-image>
          </div>
        </el-carousel-item>
      </el-carousel>
      <div class="top-content">
        <div class="title">图林</div>
        <div class="say">在线图像分享与存储平台</div>
        <button class="top-button" @click="toView">Felling</button>
      </div>
    </div>

    <el-container>
      <el-main class="main">
        <div class="wedo">
          <div class="wedo-item">
            <el-image style="width: 200px; height: 200px" src="./img/homecontent1.png" fit="cover">
            </el-image>
            <div class="wedo-item-title">创作分享</div>
            <div class="wedo-item-content">创作分享您最喜欢的图片创作</div>
          </div>
          <div class="wedo-item">
            <el-image style="width: 200px; height: 200px" src="./img/homecontent2.png" fit="cover">
            </el-image>
            <div class="wedo-item-title">云存储</div>
            <div class="wedo-item-content">前往相册中心上传保存图片</div>
          </div>
          <div class="wedo-item">
            <el-image style="width: 200px; height: 200px" src="./img/homecontent3.png" fit="cover">
            </el-image>
            <div class="wedo-item-title">相册共享</div>
            <div class="wedo-item-content">
              保存他人分享的相册 分享您的共享相册
            </div>
          </div>
        </div>
        <div class="day-star">
          <el-divider content-position="left"><span
              style="font-size: 20px; font-weight: bold">今日推荐</span>
          </el-divider>
          <div class="day-star-img">
            <div class="day-star-img-item" v-for="(img, index) in imgList" :key="index"
              @click="showImg(img.url)">
              <el-image style="width: 100%; height: 100%" :src="img.url" fit="cover"></el-image>
            </div>
          </div>
          <div class="day-star">
            <el-divider content-position="left"><span
                style="font-size: 20px; font-weight: bold">昨日之星</span>
            </el-divider>
            <div class="day-star-people">
              <div class="day-star-people-item" v-for="(people, index) in peopleList" :key="index">
                <el-avatar shape="square" :size="100" :src="people.url"></el-avatar>
                <div>
                  <el-tag type="info">Top:{{ index + 1 }}</el-tag>
                </div>
                <div>文章热度:{{ 1000 - index }}</div>
                <div>获得爱心:{{ 999 - index }}</div>
                <div>评论数:{{ 999 - index }}</div>
              </div>
            </div>
          </div>
        </div>
      </el-main>
    </el-container>
  </div>
</template>
<script>
export default {
  name: "GHome",
  data () {
    return {
      roulous: [
        {
          url: "https://myphoto-1303201423.cos.ap-shanghai.myqcloud.com/resource/roulous/4.jfif",
        },
        {
          url: "https://myphoto-1303201423.cos.ap-shanghai.myqcloud.com/resource/roulous/2.jfif",
        },
        {
          url: "https://myphoto-1303201423.cos.ap-shanghai.myqcloud.com/resource/roulous/3.jpg",
        },
        {
          url: "https://myphoto-1303201423.cos.ap-shanghai.myqcloud.com/resource/roulous/1.jfif",
        },
      ],
      imgList: [
        {
          url: "http://img.desktx.com/d/file/wallpaper/scenery/20170120/fdf948c82074494a74bf258eed4f855d.jpg",
        },
        {
          url: "http://imgs.ppt118.com/ppt/beijing/detail/2019/03/29/2496_detail-2.jpg_w800",
        },
        {
          url: "https://scpic.chinaz.net/files/pic/pic9/202009/apic27858.jpg",
        },
        {
          url: "https://uploadfile.huiyi8.com/2013/0814/20130814104134302.jpg",
        },
        {
          url: "http://img.desktx.com/d/file/wallpaper/scenery/20170331/30c29624eaadc2898dd3ca187e9e2df4.jpg",
        },
        {
          url: "http://img.desktx.com/d/file/wallpaper/scenery/20170331/30c29624eaadc2898dd3ca187e9e2df4.jpg",
        },
        {
          url: "http://img.desktx.com/d/file/wallpaper/scenery/20170331/30c29624eaadc2898dd3ca187e9e2df4.jpg",
        },
        {
          url: "http://img.desktx.com/d/file/wallpaper/scenery/20170331/30c29624eaadc2898dd3ca187e9e2df4.jpg",
        },
        {
          url: "http://img.desktx.com/d/file/wallpaper/scenery/20170331/30c29624eaadc2898dd3ca187e9e2df4.jpg",
        },
      ],
      peopleList: [
        {
          url: "https://myphoto-1303201423.cos.ap-shanghai.myqcloud.com/test/%E7%94%A8%E6%88%B7%3A16/%E6%96%87%E7%AB%A0/%E6%96%87%E7%AB%A0%3A33/e021a081-505d-42da-b085-88c31a5419c6.jpg",
        },
        {
          url: "https://myphoto-1303201423.cos.ap-shanghai.myqcloud.com/test/%E7%94%A8%E6%88%B7%3A16/%E6%96%87%E7%AB%A0/%E6%96%87%E7%AB%A0%3A33/80257c8c-6456-4031-b753-f40519573657.jpg",
        },
        {
          url: "https://myphoto-1303201423.cos.ap-shanghai.myqcloud.com/test/%E7%94%A8%E6%88%B7%3A20/%E6%96%87%E7%AB%A0/%E6%96%87%E7%AB%A0%3A55/881a9f24-83cc-4b95-8339-458e7089c0f8.jfif",
        },
        {
          url: "https://myphoto-1303201423.cos.ap-shanghai.myqcloud.com/test/%E7%94%A8%E6%88%B7%3A20/%E6%96%87%E7%AB%A0/%E6%96%87%E7%AB%A0%3A55/e2b175ec-5bb4-449f-a689-8fb26f1527f9.jpg",
        },
      ],
    };
  },
  methods: {
    showImg (url) {
      window.open(url);
    },
    //跳转详情页面
    toView () {
      this.$router.push({ path: "/view" });
      this.$bus.$emit("changeNav", false);
    },
  },
};
</script>

<style scoped>
.container {
  width: 100%;
}
.main {
  width: 100%;
}
.top {
  top: 0;
  width: 100%;
  position: relative;
}
.top-content {
  position: absolute;
  width: 400px;
  top: 190px;
  left: calc(50% - 200px);
  right: calc(50% - 200px);
  z-index: 10;
  text-align: center;
  white-space: nowrap;
}
.title {
  font-size: 60px;
  /* font-weight: bold; */
  color: white;
  /* letter-spacing: 30px; */
}
.say {
  margin-top: 10px;
  font-size: 16px;
  color: white;
  letter-spacing: 10px;
}
.top-button {
  margin-top: 30px;
  width: 100px;
  height: 40px;
  color: white;
  font-size: 15px;
  border-radius: 5px;
  background-color: var(--secondStyle);
  border: none;
  cursor: pointer;
  transition: 0.2s;
}
.top-button:hover {
  width: 110px;
  height: 45px;
}
.top-screen1 {
  position: absolute;
  bottom: -50px;
  width: 100px;
  height: 100px;
  background-color: white;
  border-radius: 40%;
  left: -50px;
  z-index: 10;
}
.top-screen2 {
  position: absolute;
  bottom: -50px;
  width: 100px;
  height: 100px;
  background-color: white;
  border-radius: 40%;
  right: -50px;
  z-index: 10;
}
.wedo {
  width: 100%;
  /* background-color: darkgreen; */
  display: flex;
  flex-wrap: wrap;
}
.wedo-item {
  flex-grow: 1;
  width: 33%;
  /* height: 300px; */
  min-width: 300px;
  text-align: center;
  /* line-height: 300px; */
  /* background-color: darkkhaki; */
  margin-top: 20px;
  margin-bottom: 30px;
}
.wedo-item-title {
  font-size: var(--midelFontSize);
  margin: 0 auto;
  margin-top: 10px;
}
.wedo-item-content {
  padding-top: 5px;
  width: 200px;
  margin: 0 auto;
  letter-spacing: 5px;
  line-height: 25px;
}
.day-star {
  margin-top: 40px;
  width: 100%;
  /* font-size: var(--midelFontSize); */
}
.day-star-img {
  width: 100%;
  white-space: nowrap;
  overflow: auto;
}
.day-star-img::-webkit-scrollbar {
  /*滚动条整体样式*/
  height: 10px;
  /* background-color: var(--firstStyle); */
}
.day-star-img::-webkit-scrollbar-thumb {
  /*滚动条里面小方块*/
  border-radius: 10px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  background: var(--thirdStyle);
}
.day-star-img-item {
  width: calc(180px + 5vw);
  height: calc(180px + 20vh);
  border: 10px solid black;
  border-right: none;
  display: inline-block;
  cursor: pointer;
}

.day-star-people {
  text-align: center;
  white-space: nowrap;
  overflow: auto;
}
.day-star-people-item {
  display: inline-block;
  margin-left: 10px;
  font-size: var(--smallFontSize);
  line-height: 20px;
  color: var(--wakeColor);
  cursor: pointer;
}
.day-star-people::-webkit-scrollbar {
  /*滚动条整体样式*/
  height: 1px;
  /* background-color: var(--firstStyle); */
}
.day-star-people::-webkit-scrollbar-thumb {
  /*滚动条里面小方块*/
  border-radius: 10px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  background: var(--thirdStyle);
}
.dadad > i {
  font-size: 30px;
  margin-left: 10px;
}
</style>